07. Lesson 1 Exercise
Lesson 1 Exercise
Overview
ND213 C04 L01 C1.7-Atom1a SC
Code Walkthrough
C1-7-A2-SC
Project Tasks
Task L1.1 : In the base class
TrafficObject
, set up a thread barrier in its destructor that ensures
that all the thread objects in the member vector_threads
are joined.Task L1.2 : In the
Vehicle
class, start a thread with the member functiondrive
and the
objectthis
as the launch parameters. Also, add the created thread into the_thread
vector of
the parent class.Task L1.3 : Vary the number of simulated vehicles in
main
and use the top function on the terminal
or the task manager of your system to observe the number of threads used by the simulation.
You can find these tasks in the project_tasks.txt
within the workspace as well.
Workspace
This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity, so you may be able to download them there.
Workspace Information:
- Default file path:
- Workspace type: react
- Opened files (when workspace is loaded): n/a
-
userCode:
export CXX=g++-7